package com.glsc.ngateway.common.base.domain.mysql.gateway.platform.flow;

import com.glsc.ngateway.common.base.domain.mysql.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author xuchang
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@Entity
@Where(clause = "deleted = 0")
@SQLDelete(sql = "update t_gw_flow_form_equipment_offline_virtual_device_detail set deleted = UNIX_TIMESTAMP(NOW()) where id=?")
@SQLDeleteAll(sql = "update t_gw_flow_form_equipment_offline_virtual_device_detail set deleted = UNIX_TIMESTAMP(NOW()) where id=?")
@Table(name = "t_gw_flow_form_equipment_offline_virtual_device_detail")
@org.hibernate.annotations.Table(appliesTo = "t_gw_flow_form_equipment_offline_virtual_device_detail", comment = "设备下架流程form表单-虚拟机子表")
public class FlowFormEquipmentOfflineVirtualDeviceDetail extends BaseEntity {

    private static final long serialVersionUID = -3728686837459228903L;

    @Column(name = "equipment_offline_id", columnDefinition = "bigint not null comment '主表ID'")
    private Long equipmentOfflineId;

    @Column(name = "virtual_device_id", columnDefinition = "int not null comment '虚拟机ID'")
    private Integer virtualDeviceId;

    @Column(name = "virtual_name", columnDefinition = "varchar(64) comment '虚拟机名称'")
    private String virtualName;

    @Column(name = "offline_reason", columnDefinition = "text comment '下架原因'")
    private String offlineReason;

}
